package com.effects.cd {
	import com.effects.CDEffect;

	/**
	 * @author Cafe
	 */
	public class CDData {
		public var startTime : uint;
		public var cdTime : uint;
		public var end : Boolean = false;
		public var cdList : Array;
		public var cdID : uint;
		public var oldTime : uint;

		public function cd(nowTime : int) : void {
			if (cdList == null) return;
			var time : uint = nowTime - startTime + oldTime;
			for (var i : int = 0; i < cdList.length; i++) {
				CDEffect(cdList[i]).model.value = int(time / cdTime * 100);
			}
			if (int(time / cdTime * 100) >= 100) end = true;
		}

		public function clear() : void {
			if (cdList == null) return;
			for (var i : int = 0; i < cdList.length; i++) {
				CDEffect(cdList[i]).model.value = 100;
			}
		}
	}
}
